﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace ZJGIS.ManageUser
{
    /// <summary>
    /// 描述：菜单项(按钮)风格（菜单项(按钮)上显示的内容）
    /// 作者：洪胜
    /// 创建日期：2010-06-18
    /// </summary>
    public enum eButtonStyle
    {        
        ImageAndText,
        Image,
        Text

    }
    /// <summary>
    /// 描述：图标显示位置
    /// 作者：洪胜
    /// 创建日期：2010-06-18
    /// </summary>
   public enum eImagePosition
    {
        Left,
        Right,
        Top,
        Bottom
    }

    /// <summary>
    /// 类描述：权限项类,可以为一个Button，也可以为包含一些Button的Group
    /// 作者：洪胜
    /// 创建日期：2010-06-18
    /// </summary>
    public interface IPrivilegeElement
    {
        /// <summary>
        /// 菜单项(按钮)的显示文本
        /// </summary>
        string Text
        {
            get;
            set;
        }

        string NakedText
        {
            get;
        }
        /// <summary>
        /// 功能类的类型名
        /// </summary>
        string TypeName
        {
            get;
            set;
        }
        /// <summary>
        /// 按钮显示风格(文字和图标、文字、图标)
        /// </summary>
        eButtonStyle ButtonStyle
        {
            get;
            set;
        }
        /// <summary>
        /// 固定图标大小(32*32 或 16*16)
        /// </summary>
        Size ImageFixedSize
        {
            get;
            set;
        }
        /// <summary>
        ///图标显示位置
        /// </summary>
        eImagePosition ImagePosition
        {
            get;
            set;
        }

        /// <summary>
        /// 权限项对应的xml
        /// </summary>
        string Xml
        {
            get;
        }
        /// <summary>
        /// 菜单项(按钮)是否可见/可用
        /// </summary>
        bool Enable
        {
            get;
            set;
        }

        /// <summary>
        /// 菜单项(按钮)是否分组
        /// </summary>
        bool BeginGroup
        {
            get;
            set;
        }
        /// <summary>
        /// 菜单项(按钮)是否垂直显示
        /// </summary>
        bool VerticalShow
        {
            get;
            set;
        }
        string KeyTips
        {
            set;
            get;
        }
      
        //bool Add2Bar
        //{
        //    get;
        //    set;
        //}
        //bool Add2Menu
        //{
        //    get;
        //    set;
        //}
       /// <summary>
       /// 
     
    }
    /// <summary>
    /// 类描述：权限组类
    /// 作者：洪胜
    /// 创建日期：2010-06-18
    /// </summary>
    public interface IPrivilegeGroup : IPrivilegeElement
    {
        void AddChild(IPrivilegeElement child);
        void RemoveChild(IPrivilegeElement child);
        List<IPrivilegeElement> GetChilds();
    }
    /// <summary>
    /// XMLtag
    /// </summary>
    public class PrivilegeXMLTag
    {
        public const string GROUPTAG = "菜单";
        public const string PRIVILEGETAG = "功能点";
        public const string NAME = "名称";
        public const string TYPE = "typename";
        //public const string ADDTOBAR = "add2toolbar";
        //public const string ADDTOMENU = "add2menu";
        public const string Enable = "enable";
        public const string BeginGroup = "begingroup";
        public const string ButtonStyle = "buttonstyle";
        public const string ImageFixedSize = "imagefixedsize";
        public const string ImagePosition = "imageposition";
        public const string  VerticalShow="verticalshow";
        public const string KeyTips = "keytips";
    }
}
